import request from '@/utils/request';

// 兑换券
export function exchangeCoupon({ couponCode, couponPwd }) {
  return request.post('/api/exchangeCoupon', {
    couponCode,
    couponPwd,
  });
}

// 查询券的状态
export function queryCouponStatus({ couponCode, couponPwd }) {
  return request.post('/api/queryCouponStatus', {
    couponCode,
    couponPwd,
  });
}

// 创建订单
export function createOrder({
  couponId, receiveName, receivePhone, receiveAddress, userRemark,
}) {
  return request.post('/api/createOrder', {
    couponId,
    receiveName,
    receivePhone,
    receiveAddress,
    userRemark,
  });
}

// 查询通知
export function getNotice() {
  return request.get('/api/getMessageContents');
}
